class CopyProxy {
  constructor(stuff) {
    this.stuff = stuff;
  }
  clone() {
    let obj = new Object();
    obj = this.stuff.bind(this.stuff);
    Object.keys(this.stuff).forEach(val => obj[val] = this.stuff[val])
    return obj;
  }
  make(obj, soil,fn) {
    this.stuff[soil] = {};
    obj[soil] = new Proxy(this.stuff[soil], {
      get: (target, key, receiver) => {
        if (!target[key]) target[key] = fn(key)
        // receiver会循环
        return Reflect.get(target, key, receiver);
      }
    })
  }
}
export default CopyProxy 